package com.gxa.modules.entity;
import javax.persistence.Entity;
import javax.persistence.Id;
import javax.persistence.GeneratedValue;
import java.io.Serializable;

import com.baomidou.mybatisplus.annotation.*;
import com.fasterxml.jackson.annotation.JsonFormat;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;

import java.util.Date;
import java.math.BigDecimal;
/** 
 * @team mackie Studio 
 * @Author kk 
 * @Date 2023-03-17 20:15:21 
 */
@Entity
@Data
@AllArgsConstructor
@NoArgsConstructor
@TableName("crm_contract" )
public class CrmContract  implements Serializable {

	private static final long serialVersionUID =  919453020997314358L;

	/**
	 * 编号（自动增长）
	 */
	@Id
	@TableId(value = "id", type = IdType.AUTO)
	private Integer id;

	/**
	 * 合同编号
	 */
   	@TableField("contract_id" )
	private String contractId;

	/**
	 * 客户编号
	 */
   	@TableField("customer_id" )
	private Integer customerId;

	/**
	 * 订单编号
	 */
   	@TableField("order_id" )
	private String orderId;

	/**
	 * 合同类型
	 */
   	@TableField("type_id" )
	private Integer typeId;

	/**
	 * 起始日期
	 */
	@JsonFormat(pattern="yyyy-MM-dd hh:mm:ss",timezone="GMT+8")
   	@TableField("start_date" )
	private Date startDate;

	/**
	 * 到期日期
	 */
	@JsonFormat(pattern="yyyy-MM-dd hh:mm:ss",timezone="GMT+8")
   	@TableField("expiration_date" )
	private Date expirationDate;

	/**
	 * 总金额
	 */
   	@TableField("money" )
	private BigDecimal money;

	/**
	 * 已收款
	 */
   	@TableField("payment" )
	private BigDecimal payment;

	/**
	 * 欠款
	 */
   	@TableField("debt" )
	private BigDecimal debt;

	/**
	 * 合同状态
	 */
   	@TableField("status" )
	private String status;

	/**
	 * 是否提供发票
	 */
   	@TableField("is_receipt" )
	private String isReceipt;

	/**
	 * 是否含税
	 */
   	@TableField("is_tax" )
	private String isTax;

	/**
	 * 备注
	 */
   	@TableField("remark" )
	private String remark;

	/**
	 * 业务人员
	 */
   	@TableField("business_id" )
	private Integer businessId;

	/**
	 * 录入时间
	 */
	@JsonFormat(pattern="yyyy-MM-dd hh:mm:ss",timezone="GMT+8")
   	@TableField("enter_date" )
	private Date enterDate;

	/**
	 * 审核时间
	 */
	@JsonFormat(pattern="yyyy-MM-dd hh:mm:ss",timezone="GMT+8")
   	@TableField("auditor_date" )
	private Date auditorDate;

	/**
	 * 审核人员
	 */
   	@TableField("auditor_id" )
	private Integer auditorId;

	/**
	 * 删除状态（1存在 0删除）
	 */
	@TableLogic
   	@TableField("deleted_state")
	private Integer deletedState;

	public CrmContract(String contractId, Integer customerId, String orderId, Integer typeId, Date startDate, Date expirationDate, BigDecimal money, BigDecimal payment, BigDecimal debt, String status, String isReceipt, String isTax, String remark, Integer businessId, Date enterDate, Integer deletedState) {
		this.contractId = contractId;
		this.customerId = customerId;
		this.orderId = orderId;
		this.typeId = typeId;
		this.startDate = startDate;
		this.expirationDate = expirationDate;
		this.money = money;
		this.payment = payment;
		this.debt = debt;
		this.status = status;
		this.isReceipt = isReceipt;
		this.isTax = isTax;
		this.remark = remark;
		this.businessId = businessId;
		this.enterDate = enterDate;
		this.deletedState = deletedState;
	}
}
